# encoding: utf-8
""" 
@version: v1.0 
@author: autumner 
@license: Apache Licence  
@contact: 18322313385@163.com 
@site:  https://gitee.com/autumner/pythoncookbook
@software: PyCharm 
@file: event_UDPClient.py 
@time: 2019/7/23 下午2:22
@note:基于事件的UDP客户端

"""
from socket import socket, AF_INET, SOCK_DGRAM


s = socket(AF_INET, SOCK_DGRAM)
s.sendto(b'', ('10.120.21.192', 14000))
print(s.recvfrom(128))
s.sendto(b'Hello', ('localhost', 15000))
print(s.recvfrom(128))